"""
读取数据
"""
import pandas as pd


class TrainDataReader:
    def __init__(self, basePath: str):
        trainExampleDataPath = basePath+"/A/1.样例数据（甲）.xls"
        fireElectric = pd.read_excel(trainExampleDataPath, sheet_name="热力电厂")
        self.FireElectric = fireElectric.iloc[0:, 1:].to_numpy()
        # print("fire=\n", fireElectric)

        waterElectric = pd.read_excel(trainExampleDataPath, sheet_name="水电")
        self.WaterElectric = waterElectric.iloc[0:, 1:].to_numpy()
        # print("water power=\n", waterElectric)

        payload = pd.read_excel(trainExampleDataPath, sheet_name="负荷")
        self.Payload = payload.iloc[1:, 0:].to_numpy()
        # print("payload=\n", payload)

        self.Connection = pd.read_excel(
            trainExampleDataPath, sheet_name="联络线").to_numpy()
        # print("connection=\n", connection)

        self.StoragePower = pd.read_excel(
            trainExampleDataPath, sheet_name="储能").to_numpy()
        # print("storage=\n", storagePower)

        trainNewPowerDataPath = basePath+"/A/2.新能源时序（甲）.xlsx"
        newPowerSchedule = pd.read_excel(trainNewPowerDataPath)
        self.NewPower = newPowerSchedule.iloc[2:, 0:].to_numpy()

        trainWaterPowerDataPath = basePath+"/A/3.水电月平均出力曲线（甲）.xlsx"
        self.WaterPowerGraph = pd.read_excel(
            trainWaterPowerDataPath).to_numpy()

        trainConnectionGraphPath = basePath+"/A/4.联络线曲线（甲）.xlsx"
        self.ConnectionGraph = pd.read_excel(
            trainConnectionGraphPath).to_numpy()
